/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#pragma once

#include <string>
#include <NoCopy.h>
#include <threads/Thread.h>
#include <threads/Lock.h>
#include <Creator.h>
#include <WindowCreatorIphone.h>
#include <Config.h>

namespace liba
{

class WindowImpl;

class ApplicationWindowed : 
	virtual public Creator,
	virtual public WindowCreator
{	
	std::string caption;
protected:
	bool active;
	bool quit;
	bool last_pressed_button;

	void set_property( const std::string & nam, int val );
	void set_focus();
public:
	void set_quit()
	{
		quit = true;
	}
//	virtual int window_proc( const EventRecord & event );

	explicit ApplicationWindowed(const std::string & caption, const std::string & cmd_line, WindowImpl * impl);
	ApplicationWindowed(const std::string & caption, WindowImpl * impl);
	virtual ~ApplicationWindowed();

	virtual bool LifeCycle(liba::time_float delta_time);
	virtual bool render()
	{
		return false;
	}
	int start();
	static int get_good_start_result()
	{
		return 2000000000;
	}
	const std::string & get_caption()const
	{
		return caption;
	}
};

} // namespace liba
using namespace liba;
